-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add YaDocs connector #80
Conversation
53c7dc3
to
6aa51f2
Compare
NOTIF_TYPE_GSHEETS_V2_STALE_DATA = NotificationType.declare("stale_data") | ||
NOTIF_TYPE_GSHEETS_V2_DATA_UPDATE_FAILURE = NotificationType.declare("data_update_failure") | ||
NOTIF_TYPE_GSHEETS_V2_STALE_DATA = NOTIF_TYPE_STALE_DATA | ||
NOTIF_TYPE_GSHEETS_V2_DATA_UPDATE_FAILURE = NOTIF_TYPE_DATA_UPDATE_FAILURE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these notifications are basically the same, I think there is no need to specify their copies with specific names. What I mean is, we can just use NOTIF_TYPE_STALE_DATA & NOTIF_TYPE_DATA_UPDATE_FAILURE where they are needed, without these assignments
) | ||
from dl_connector_bundle_chs3.constants import NOTIF_TYPE_STALE_DATA, NOTIF_TYPE_DATA_UPDATE_FAILURE | ||
|
||
CONNECTION_TYPE_YADOCS = ConnectionType.declare("yadocs") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed to just docs
from dl_connector_bundle_chs3.chs3_yadocs.core.us_connection import YaDocsFileS3Connection | ||
|
||
|
||
class YaDocsFileS3ConnectionLifecycleManager( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember that we agreed not to create a lifecycle manager before we bother about data update
This cannot work at the moment because the only data update file-uploader-api is aware of is for gsheets
But ok, let's keep it
class StaleDataNotification(BaseNotification): | ||
type = NOTIF_TYPE_YADOCS_STALE_DATA | ||
_title = "Stale data" | ||
_message = "The data has not been updated for more than 30 minutes, a background update is in progress" | ||
_level = NotificationLevel.info | ||
|
||
|
||
class DataUpdateFailureNotification(BaseNotification): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as for notification types
These notifications are pretty generic, I think we can just have them in chs3_base
@@ -12,5 +12,8 @@ msgstr "" | |||
msgid "label_connector-gsheets_v2" | |||
msgstr "Google Sheets" | |||
|
|||
msgid "label_connector-gsheets_v2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong id
@@ -160,10 +161,17 @@ def _make_id(self, field: converter_parsing_utils.TResultColumn) -> str: | |||
return idx_to_alphabet_notation(field["index"]) # type: ignore # TODO: FIX | |||
|
|||
|
|||
@attr.s | |||
class YaDocsFieldIdGenerator(FileUploaderFieldIdGenerator): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should discuss this a bit more later
We had to implement alphabet notation for gsheets_v2 to remain consistency with the old gsheets connector, I'm not ready to neither confirm or deny that we need it in YaDocs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it used anywhere?
38bc2bc
to
593a40a
Compare
NOTIF_TYPE_GSHEETS_V2_STALE_DATA, | ||
from dl_connector_bundle_chs3.chs3_base.core.constants import ( | ||
NOTIF_TYPE_DATA_UPDATE_FAILURE, | ||
NOTIF_TYPE_STALE_DATA, | ||
) | ||
|
||
|
||
class StaleDataNotification(BaseNotification): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This too
No description provided.